package com.zan.pattern.command;

/**
 * @Author Zan
 * @Create 2024/4/27 10:05
 * @Description : TODO(请用一句话描述该类的功能)
 * @ClassName: Client
 */
public class Client {
    public static void main(String[] args) {
        // 创建第一个订单对象
        Order order1 = new Order();
        order1.setDiningTable(1);
        order1.setFood("鱼香肉丝", 1);
        order1.setFood("小杯可乐", 1);

        // 创建第二个订单对象
        Order order2 = new Order();
        order2.setDiningTable(2);
        order2.setFood("小炒牛肉", 1);
        order2.setFood("小杯雪碧", 1);

        // 创建接收者对象 - 厨师对象
        SeniorChef seniorChef = new SeniorChef();
        // 创建命令对象
        OrderCommand cmd1 = new OrderCommand(seniorChef, order1);
        OrderCommand cmd2 = new OrderCommand(seniorChef, order2);

        // 创建调用者（服务员对象）
        Waitor invoke = new Waitor();
        invoke.setCommand(cmd1);
        invoke.setCommand(cmd2);

        // 调用命令
        invoke.orderUp();
    }
}
